<?php
require("./config.php");

    if (filter_input(INPUT_POST, 'req') == "sesion_destroy") 
    {
        $json = array("success" => false, "msg" => "", "user" => "desloggeado");
        if (!isset($_SESSION['logged']) || $_SESSION['logged'] == "no") 
        {
         
        } 
        else
        { 
            session_destroy(); 
            $json['user'] = "desloggeado";
            $json['success'] = false;
            $json['msg'] = "Sesion destroyed!"; 
        }
        print(json_encode($json));
    }